package file;

import java.io.Serializable;
import java.util.List;

public class Book implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;
	private int age;
	private List<String> otherInf;
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + age;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((otherInf == null) ? 0 : otherInf.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Book other = (Book) obj;
		if (age != other.age)
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (otherInf == null) {
			if (other.otherInf != null)
				return false;
		} else if (!otherInf.equals(other.otherInf))
			return false;
		return true;
	}

	public Book(String name,int age,List<String> otherInf) {
		this.age = age;
		this.name = name;
		this.otherInf = otherInf;
	}

	@Override
	public String toString() {
//		 + ", age=" + age 
		return "Book [name=" + name + ", age=" + age + ", otherInf=" + otherInf + "]";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public List<String> getOtherInf() {
		return otherInf;
	}

	public void setOtherInf(List<String> otherInf) {
		this.otherInf = otherInf;
	}
	
	
	
	

	
}
